home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Internet
/
Collection of Internet.iso
/
infosrvr
/
doc
/
www_talk.arc
/
000346_connolly@pixel.convex.com _Thu Nov 19 05:43:14 1992.msg
< prev
next >
Wrap
Internet Message Format
|
1992-11-30
|
2KB
Return-Path: <connolly@pixel.convex.com>
Received: from dxmint.cern.ch by nxoc01.cern.ch (NeXT-1.0 (From Sendmail 5.52)/NeXT-2.0)
id AA12924; Thu, 19 Nov 92 05:43:14 MET
Received: by dxmint.cern.ch (dxcern) (5.57/3.14)
id AA07607; Thu, 19 Nov 92 05:55:47 +0100
Received: from convex.convex.com by mcsun.EU.net with SMTP
id AA16779 (5.65b/CWI-2.187); Thu, 19 Nov 1992 05:55:31 +0100
Received: from pixel.convex.com by convex.convex.com (5.64/1.35)
id AA26388; Wed, 18 Nov 92 22:54:12 -0600
Received: from localhost by pixel.convex.com (5.64/1.28)
id AA08886; Wed, 18 Nov 92 22:54:11 -0600
Message-Id: <9211190454.AA08886@pixel.convex.com>
To: marca@ncsa.uiuc.edu (Marc Andreessen)
Cc: www-talk@nxoc01.cern.ch
Subject: Re: html-mode.el update
In-Reply-To: Your message of "Wed, 18 Nov 92 21:42:37 PST."
<9211190542.AA09366@wintermute.ncsa.uiuc.edu>
Date: Wed, 18 Nov 92 22:54:10 CST
From: Dan Connolly <connolly@pixel.convex.com>
Here's a patch to add a function to fix all the existing
HREFs in an HTML file so they'll have quotes around them.
Dan
*** /mnt/connolly/foo Wed Nov 18 22:51:50 1992
--- html-mode.el Wed Nov 18 22:50:32 1992
***************
*** 517,522 ****
--- 517,543 ----
(setq html-link-counter (1+ html-link-counter))
(replace-string-in-buffer start (1- end)
(format "%d" html-link-counter))))))))
+
+ (defun html-quote-hrefs ()
+ "Insert quotes around all HREF attribute value literals.
+
+ This remedies the problem with old html files that can't be
+ processed by SGML parsers. That is, changes
+ <A HREF=foo> to <A HREF="foo">.
+
+ By Dan Connolly, so don't yell at Mark if it breaks."
+ (interactive)
+ (save-excursion
+ (goto-char (point-min))
+ (setq html-link-counter 0)
+ (while (re-search-forward "<[aA][ \t\n]+\\([nN][aA][mM][eE]=[a-zA-Z0-9]+[ \t\n]+\\)?[hH][rR][eE][fF]=" (point-max) t)
+ (cond ((null (looking-at "\""))
+ (insert "\"")
+ (re-search-forward "[ \t\n>]" (point-max) t)
+ (forward-char -1)
+ (insert "\"")
+ ))
+ ) ) )
;;; ------------------------------- html-mode --------------------------------